{extend name="adminblue/base" /}
{block name="resources"/}
<link rel="stylesheet" type="text/css" href="ADMIN_CSS/member_list.css" />
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<style>
.head-portrait{
	margin-top:15px;
}
.mytable th {
    padding-left: 0px;
}
.btn-common-white{
	line-height:20px;
}
.member-div label{
	font-size:12px;
}
</style>
{/block}
{block name="main"}
<table class="mytable">
	
	<tr>
		<th style="text-align: left;width: 20%;">
			<button class="btn-common-delete" onclick="batchDelete()" >批量删除</button>
			<button class="btn-common" onclick="add_user()" >添加会员</button>
			<button onclick="dataExcel()" value="导出数据" class="btn-common-white"  >导出数据</button>
		</th>
		<th style="width:50%;"> 
			<span>注册时间：</span>
			<input type="text" id="startDate" class="input-common middle" placeholder="请选择开始日期" onclick="WdatePicker()" />
			&nbsp;-&nbsp;
			<input type="text" id="endDate" placeholder="请选择结束日期" class="input-common middle" onclick="WdatePicker()" />
			<!-- 更多搜索按钮 -->
			<button class="btn-common-white more-search"><i class="fa fa-chevron-down"></i></button>
			<button onclick="searchData()" value="搜索" class="btn-common" >搜索</button>
			<!-- 更多搜索下拉框 -->
			<div class="more-search-container">
				<dl>
					<dt>搜索内容：</dt>
					<dd>
						<input type="text" id ='search_text' placeholder="手机号/邮箱/会员昵称" class="input-common middle" />
					</dd>
				</dl>
				<dl>
					<dt>会员等级：</dt>
					<dd>
						<select id="level_name" class="select-common middle">
							<option value ="-1">请选择会员等级</option>
							{volist name="level_list['data']" id="vo"}
							<option value ="{$vo.level_id}">{$vo.level_name}</option>
							{/volist}
						</select>
					</dd>
				</dl>
				<dl>
					<dt></dt>
					<dd><button onclick="searchData()" class="btn-common">搜索</button></dd>
				</dl>
			</div>
		</th>
	</tr>
</table>
<table class="table-class">
	<colgroup>
	<col style="width: 2%;">
	<col style="width: 25%;">
	<col style="width: 7%;">
	<col style="width: 10%;">
	<col style="width: 10%;">
	<col style="width: 20%;">
	<col style="width: 6%;">
	<col style="width: 20%;">
	</colgroup>
	<thead>
		<tr align="center">
			<th><i class="checkbox-common"><input type="checkbox" onclick="CheckAll(this)"></i></th>
			<th style="text-align:left;">会员</th>
			<th style="text-align:left;">会员等级</th>
			<th style="text-align:right;">积分</th>
			<th style="text-align:right;">账户余额</th>
			<th>注册&登录</th>
			<th>状态</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody id="productTbody"></tbody>
</table>


<!-- 余额调整 -->
<div class="modal fade hide" id="recharge_balance" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3>调整余额</h3>
			</div>
			<div class="modal-body">
				<div class="modal-infp-style">
					<table>
						<tr>
							<td>当前余额</td>
							<td colspan='3' id="current_balance" class="input-common" ></td>
						</tr>
						<tr>
							<td>调整金额</td>
							<td colspan='3' id="time">
								<input type="number" id="balance" class="input-common harf" /><em class="unit">元</em>
								<p class="hint">输入负数表示为减少</p>
							</td>
						</tr>
						<tr>
							<td>备注</td>
							<td colspan='3' id="time"><textarea id="remark_balance" class="textarea-common"></textarea></td>
						</tr>
					</table>
				</div>
			</div>
			
			<div class="modal-footer">
				<input type="hidden" id="balance_id" />
				<button class="btn-common btn-big" onclick="addAccount(2)">保存</button>
				<button class="btn-common-cancle btn-big" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
	
</div>

<!-- 积分调整 -->
<div class="modal fade hide" id="recharge_point" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3>调整积分</h3>
			</div>
			<div class="modal-body">
				<div class="modal-infp-style">
					<table>
						<tr>
							<td>当前积分</td>
							<td colspan='3' id="current_point" class="input-common"></td>
						</tr>
						<tr>
							<td>调整积分</td>
							<td colspan='3' id="time">
								<input type="number" id="point" class="input-common harf"><em class="unit">分</em>
								<p class="hint">输入负数表示为减少</p>
							</td>
						</tr>
						<tr>
							<td>备注</td>
							<td colspan='3' id="time"><textarea id="remark_point" class="textarea-common"></textarea></td>
						</tr>
					</table>
					
				</div>
			</div>
			<div class="modal-footer">
				<input type="hidden" id="point_id" />
				<button class="btn-common btn-big" onclick="addAccount(1)">保存</button>
				<button class="btn-common-cancle btn-big" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
	
</div>

<!-- 添加会员 -->
<div class="modal fade hide" id="add_user" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3>添加会员</h3>
			</div>
			<div class="modal-body">
				<div class="modal-infp-style">
					<table class="modal-tab">
						<tr>
							<td style="width:20%;"><span class="required">*</span>用户名</td>
							<td colspan='3'>
								<input type="text" id="username" class="input-common" />
								<span id="usernameyz"></span>
								<input type="hidden" value="不存在" id="isset_username" class="input-common" />
							</td>
						</tr>
						<tr>
							<td><span class="required">*</span>登录密码</td>
							<td colspan='3'><input type="password" id="password" class="input-common"></td>
						</tr>
						<tr>
							<td style="width:22%;"><span class="required">*</span>昵称</td>
							<td colspan='3'>
								<input type="text" id="nickname" class="input-common" />
							</td>
						</tr>
						<tr>
							<td>会员等级</td>
							<td colspan='3'>
								{if $level_list['data']}
								<select id="member_level" class="select-common">
									{foreach name="level_list['data']" item="vo"}
									<option value="{$vo.level_id}">{$vo.level_name}</option>
									{/foreach}
								</select>
								{else/}
								<span>暂无会员等级分类</span>
								{/if}
							</td>
						</tr>
						<tr>
							<td>手机号码</td>
							<td colspan='3'><input type="text" id="telephone" class="input-common"/><span id="telephoneyz"></span></td>
						</tr>
						<tr>
							<td>邮箱地址</td>
							<td colspan='3'><input type="text" id="member_email" class="input-common" /><span id="member_emailyz"></span></td>
						</tr>
						<tr>
							<td>性别</td>
						
							<td>				
							<label class="radio inline normal"><i class="radio-common selected"><input type="radio" checked="checked" name="sex" value="1"/></i>
							<span>男</span></label>
							<label class="radio inline normal"><i class="radio-common"><input name="sex" type="radio" value="2"/></i>
							<span>女</span></label>
							<label class="radio inline normal"><i class="radio-common"><input name="sex" type="radio" value="0"/></i>
							<span>保密</span></label>
							</td>
						</tr>
						<tr>
							<td>账户状态</td>
							<td>
							<label  class="radio inline normal"><i class="radio-common selected"><input type="radio" checked="checked" name="status" value="1"/></i>
							<span>正常</span></label>
							<label  class="radio inline normal"><i class="radio-common"><input name="status" type="radio" value="0"/></i>
							<span>锁定</span></label>
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<div class="modal-footer">
				<button class="btn-common btn-big" onclick="addUser()">保存</button>
				<button class="btn-common-cancle btn-big" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
	
</div>

<input type="hidden" id="modify_uid"/>
<!-- 修改会员 -->
<div class="modal fade hide" id="modify_user" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

	<div class="modal-dialog" >
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3 class="modal-title" id="myModalLabel">编辑会员</h3>
			</div>
			<div class="modal-body" style="min-height: 360px;">
				<div class="modal-infp-style">
					<table class="modal-tab">
						<tr style="height: 32px;">
							<td style="width:20%"><span class="required">*</span>用户名</td>
							<td colspan='3'>
<!-- 								<span id="modify_username"></span> -->
								<input type="text" id="modify_username" class="input-common" />
								<span id="modify_usernameyz"></span>
								<input type="hidden" value="不存在" id="modify_isset_username"/>
							</td>
						</tr>
						<tr>
							<td style="width:20%">昵称</td>
							<td colspan='3'><input type="text" id="modify_nickname" class="input-common"/></td>
						</tr>
						<tr>
							<td>会员等级</td>
							<td colspan='3' style="padding-bottom: 0;">
								<p>
									{if $level_list['data']}
									<select id="modify_member_level" class="select-common">
										{foreach name="level_list['data']" item="vo"}
										<option value="{$vo.level_id}">{$vo.level_name}</option>
										{/foreach}
									</select>
									{else/}
									<span>暂无会员等级分类</span>
									{/if}
								</p>
							</td>
						</tr>
						<tr>
							<td>手机号码</td>
							<td colspan='3'><input type="text" id="modify_telephone" value="" class="input-common"/><span id="modify_telephoneyz"></td>
						</tr>
						<tr>
							<td>邮箱地址</td>
							<td colspan='3'><input type="text" id="modify_member_email" class="input-common"/><span id="modify_member_emailyz"></td>
						</tr>
				
						<tr>
							<td>性别</td>
						
							<td id="sex">				
							<label class="radio inline normal"><i class="radio-common"><input type="radio" checked="checked" name="sex" value="1"/></i>
							<span>男</span></label>
							<label class="radio inline normal"><i class="radio-common"><input name="sex" type="radio" value="2"/></i>
							<span>女</span></label>
							<label class="radio inline normal"><i class="radio-common"><input name="sex" type="radio" value="0"/></i>
							<span>保密</span></label>
							</td>
						</tr>
						<tr>
							<td>账户状态</td>
							<td  id="status">
							<label  class="radio inline normal"><i class="radio-common"><input type="radio" checked="checked" name="status" value="1"/></i>
							<span>正常</span></label>
							<label  class="radio inline normal"><i class="radio-common"><input name="status" type="radio" value="0"/></i>
							<span>锁定</span></label>
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<div class="modal-footer">
				<input type="hidden" id="modify_username_hidden" />
				<input type="hidden" name="" id="hidden_old_username" value="">
				<button class="btn-common btn-big" onclick="modifyUser()" id="butSubmit"  >保存</button>
				<button class="btn-common-cancle btn-big" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
	
</div>

<!-- 修改会员密码 -->
<div class="modal fade hide" id="modify_password" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3 id="myModalLabel">重置密码</h3>
			</div>
			<div class="modal-body">
				<div class="modal-infp-style">
					<table class="modal-tab">
						<tr>
							<td style="width:20%">密码</td>
							<td colspan='3'><input type="text" id="modify_passwords" class="input-common"/></td>
						</tr>
					</table>
				</div>
			</div>
			
			<div class="modal-footer">
				<input type="hidden" id="modify_userid" />
				<button class="btn-common btn-big" onclick="modifypassword()">保存</button>
				<button class="btn-common-cancle btn-big" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
	
</div>
<!-- txx设置特殊商品价格s -->
<div class="modal fade hide" id="teshujiage" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width: 90%;left: auto;right: auto;margin: 0;position: absolute;">

	<div class="modal-dialog" >
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="">设置特殊价格</h4>
			</div>
			<div class="modal-body">
				<div class="modal-infp-style">
					<table id="tsjg">
						<tr>
							<td>当前余额</td>
							<td>122321</td>
							<td colspan='2' >213213</td>
						</tr>

					</table>
				</div>
			</div>

			<div class="modal-footer">
				<input type="hidden" id="teshujiages" />
				<!--<button class="btn btn-info" onclick="addAccount(2)" id="butSubmit" data-dismiss="modal" aria-hidden="true" style="display:inline-block;">保存</button>-->
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>

</div>
<!-- txx设置特殊商品价格e -->
<!-- txx扩展信息s -->
<div class="modal fade hide" id="recharge_reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 

	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3>扩展信息</h3>
			</div>
			<div class="modal-body">
				<div class="modal-infp-style">
					<table>
						<tr>
							<td>区域</td>
							<td colspan='3' >
								<select name="dq" id="dq" >
									<option value="0">请选择区域</option>
									{foreach name="dqs" item="vo"}
									<option value="{$vo.id}">{$vo.names}</option>
									{/foreach}
								</select>
								
							</td>
						</tr>
						<tr>
							<td>店铺名称</td>
							<td colspan='4' >
								<input type="text" id="modify_dianpu" class="input-common harf" />
							</td>
						</tr>
						<tr>
							<td>账期类型</td>
							<td colspan='3' >
								<input type="text" id="modify_zhangqi" class="input-common harf" />
							</td>
						</tr>
						<tr>
							<td>客户类型</td>
							<td colspan='3' >
								<input type="text" id="modify_kehu" class="input-common harf" />
							</td>
						</tr>
						<tr>
							<td>店面面积</td>
							<td colspan='3' >
								<input type="number" id="modify_mianji" class="input-common harf" />
							</td>
						</tr>
						<tr>
							<td>区域经理</td>
							<td colspan='3' >
								<input type="text" id="modify_jingli" class="input-common harf" />
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<div class="modal-footer">
				<input type="hidden" id="balance_id" />
				<button class="btn-common btn-big" onclick="kuozhan()">保存</button>
				<button class="btn-common-cancle btn-big" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
	
</div>
<!-- txx扩展信息e -->

<!-- txx收货地址s -->
<div class="modal fade hide" id="address_list" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width: 90%;left: auto;right: auto;margin: 0;position: absolute;">

	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" onclick="location.href=location;"  data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3>收货地址</h3>
			</div>
			<div class="modal-body" style="height: 70%;">
				<div class="modal-infp-style">
					<table id="shdizhi" style="margin-bottom: 15px;"></table>
					<table >
						<tbody>
						<tr>
							<td style="width:20%">昵称</td>
							<td colspan="3"><input type="text" id="consigner" value="">
								<input type="hidden" id="addressid"></td>
						</tr>
						<tr>
							<td>手机号码</td>
							<td colspan="3"><input type="text" id="mobile" value=""></td>
						</tr>
						<tr>
							<td style="width:20%">选择地区</td>
							<td colspan="3">
								<p>
									<select name="pro_id" id="selProvinces" onchange="getProvince()">
										{foreach name="prolist" item="vo"}
										<option value="{$vo.province_id}">{$vo.province_name}</option>
										{/foreach}
									</select>
									<script>
                                        function getProvince() {
                                            var id = $('#selProvinces').find("option:selected").val();
                                            $.ajax({
                                                type : "post",
                                                url : __URL("wap/login/getcity"),
                                                data : {"province_id":id},
                                                success : function(data) {
//                                                    alert(data);
                                                    $('#selCities').html(data);

                                                }
                                            });
                                        };
									</script>
									<select name="city_id" id="selCities" onchange="getarea()" class="select_addr">
										<option value="-1">请选择市</option>
										{foreach name="citylist" item="vo"}
										<option value="{$vo.city_id}">{$vo.city_name}</option>
										{/foreach}
									</select>

									<script>
                                        function getarea() {
                                            var id = $('#selCities').find("option:selected").val();
                                            $.ajax({
                                                type : "post",
                                                url : __URL("wap/login/getarea"),
                                                data : {"city_id":id},
                                                success : function(data) {
//                                                    alert(data);
                                                    $('#selDistricts').html(data);

                                                }
                                            });
                                        };
									</script>
									<select name="dis_id" id="selDistricts">
										<option value="-1">请选择区</option>
										{foreach name="dislist" item="vo"}
										<option value="{$vo.district_id}">{$vo.district_name}</option>
										{/foreach}
									</select>
								<div class="required-notice fl">
									<i class="notice-icon"></i><span class="notice-text address-notice"></span>
								</div>
								</p>
							</td>
						</tr>
						<tr>
							<td>详细地址</td>
							<td colspan="3"><input type="text" id="waddress" value=""></td>
						</tr>
						
					</tbody>
					</table>
				</div>
			</div>
			
			<div class="modal-footer">
				<input type="hidden" id="balance_id" />
				<button class="btn-common btn-big" onclick="saveaddress()">保存</button>
				<button class="btn-common-cancle btn-big" onclick="location.href=location;" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
	
</div>
<script>
	function addshdizhi(id){
	    if(id>0){
            jQuery.ajax({
                type: "POST",
                url: "{:__URL('ADMIN_MAIN/member/findaddress')}",
                global: false,
                dataType: "json",
                data: {'id':id},
                success: function (arr) {
                    $('#consigner').val(arr.consigner);
                    $('#mobile').val(arr.mobile);
                    $('#waddress').val(arr.address);
                    $('#addressid').val(arr.id);
                    var html1='<option value="'+arr.province+'">'+arr.sheng+'</option>';
                    $('#selProvinces').html(html1);
                    var html2='<option value="'+arr.city+'">'+arr.shi+'</option>';
                    $('#selCities').html(html2);
                    var html3='<option value="'+arr.district+'">'+arr.xian+'</option>';
                    $('#selDistricts').html(html3);
                    $('#address_list').show();
                }
            })
		}else{
            $('#address_list').show();
		}

	}
    function saveaddress(){
        var addressid= $('#addressid').val();
        var uid= $('#modify_uid').val();
        var consigner= $('#consigner').val();
        var mobile= $('#mobile').val();
        var waddress= $('#waddress').val();
        var selProvinces= $('#selProvinces').val();
        var selCities= $('#selCities').val();
        var selDistricts= $('#selDistricts').val();
        if(consigner == '' || waddress == '' || mobile == ''){
        	alert('请填写完整的收货地址信息');
        	return false;
        }
        jQuery.ajax({
            type: "POST",
            url: "{:__URL('ADMIN_MAIN/member/saveaddress')}",
            global: false,
            dataType: "json",
            data: {'addressid':addressid,'uid':uid,'consigner':consigner,'mobile':mobile,'address':waddress,'selProvinces':selProvinces,'selCities':selCities,'selDistricts':selDistricts},
            success: function (arr) {
                if(arr.code==1){
                    alert('操作成功');
                    location=location;
				}else{
                    var html='';
                    html +='<tr><td>收货地址</td><td colspan="3"><p style="width:80%;float:left;">姓名：'+arr.consigner+'  手机号：'+arr.mobile+'   地址：'+arr.zuhedizhi+'</p><input type="radio" name="default" style="float: left;margin-top: 8px;" id="moren'+arr.id+'" onclick="setdefault('+arr.id+','+arr.uid+')"><label for="moren'+arr.id+'" style="width: 30px;margin-top: 4px;margin-right:10px;" onclick="setdefault('+arr.id+','+arr.uid+')">默认</label><button class="btn btn-info" onclick="addshdizhi('+arr.id+')"  style="display:inline-block;margin-right:10px;">编辑</button><button type="button" class="btn btn-default" onclick="deladdress('+arr.id+',this)">删除</button></td></tr>';
                    $('#shdizhi').append(html);
                    $('#consigner').val('');
                    $('#mobile').val('');
                    $('#waddress').val('');alert('操作成功');
				}


            }
        })

    }
    function deladdress(id){
        jQuery.ajax({
            type: "POST",
            url: "{:__URL('ADMIN_MAIN/member/deladdress')}",
            global: false,
            dataType: "json",
            data: {'id':id},
            success: function (arr) {
                alert('删除成功');
                location=location;
            }
        })
	}
</script>
<!-- txx收货地址e -->

{/block}
{block name="script"}
<script type="text/javascript">
function LoadingInfo(page_index) {
	var search_text = $("#search_text").val();
	var levelid = $("#level_name").val();
	var start_date = $("#startDate").val();
	var end_date = $("#endDate").val();
	var status = $("#status_search").val();
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/memberlist')}",
		data : {
			"page_index" : page_index, "page_size" : $("#showNumber").val(), "search_text" : search_text,"levelid":levelid, 
			"start_date" : start_date, "end_date" : end_date, "status" : status
		},
		success : function(data) {
			if (data["data"].length > 0) {
				$(".table-class tbody").empty();
				for (var i = 0; i < data["data"].length; i++) {
					var html = '';
					html += '<tr align="center">';
					html += '<td><i class="checkbox-common"><input name="sub" type="checkbox" value="'+ data["data"][i]["uid"]+'"></i></td>';
					html += '<td align="left">';
						
					if(data["data"][i]["user_headimg"] ==""){
						html += '<img src="{:__IMG($default_headimg)}" class="head-portrait"/>';
						html += '<div style="float:left;" class="member-div">';
						if(data["data"][i]["user_name"] == '' || data["data"][i]["user_name"] == null){
// 							html+='用户名:'+'--'+'<br/>';
							html += '<label style="float:none;width:100%">用户名：<span>--</span></label>';
						}else{
// 							html+='用户名:'+data["data"][i]["user_name"] +'<br/>';
							html += '<label style="float:none;width:100%">用户名：<span>' + data["data"][i]["user_name"] + '</span></label>';
						}
						if (data["data"][i]["user_tel"] == null || "" == data["data"][i]["user_tel"]) {
							if (data["data"][i]["user_email"] == null || "" == data["data"][i]["user_email"]) {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 :'+'--'+'<br/>'+'邮箱 : '+'--';
								html += '<label style="float:none;width:100%">昵称: <span>' + data["data"][i]["nick_name"] + '</span></label>';
								html += '<label style="float:none;width:100%"><span>手机：--</span></label>';
								html += '<label style="float:none;width:100%"><span>邮箱：--</span></label>';
							} else {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 : '+'--'+'<br/>'+'邮箱 : '+data["data"][i]["user_email"];
								html += '<label style="float:none;width:100%">昵称 :<span>' + data["data"][i]["nick_name"] + '</span></label>';
								html += '<label style="float:none;width:100%"><span>手机：--</span></label>';
								html += '<label style="float:none;width:100%"><span>邮箱：' + data["data"][i]["user_email"] + "</span></label>";
							}
						} else {
							if (data["data"][i]["user_email"] == null || "" == data["data"][i]["user_email"]) {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 : '+data["data"][i]["user_tel"]+'<br/>'+'邮箱 : '+'--';
								html += '<label style="float:none;width:100%">昵称：<span>' + data["data"][i]["nick_name"] + "</span></label>";
								html += '<label style="float:none;width:100%">手机：<span>' + data["data"][i]["user_tel"] + "</span></label>";
								html += '<label style="float:none;width:100%">邮箱：<span>--</span></label>';
							} else {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 : '+data["data"][i]["user_tel"]+'<br/>'+'邮箱 : '+data["data"][i]["user_email"];
								html += '<label style="float:none;width:100%">昵称：<span>' + data["data"][i]["nick_name"] + '</span></label>';
								html += '<label style="float:none;width:100%">手机：<span>' + data["data"][i]["user_tel"] + '</span></label>';
								html += '<label style="float:none;width:100%">邮箱：<span>' + data["data"][i]["user_email"] + "</span></label>";
							}
						}
					}else{
						html += '<img src="'+__IMG(data["data"][i]["user_headimg"])+'" class="head-portrait"  onerror="this.src=\'{:__IMG($default_headimg)}\'"/>';
						if (data["data"][i]["user_tel"] == null || "" == data["data"][i]["user_tel"]) {
							if (data["data"][i]["user_email"] == null || "" == data["data"][i]["user_email"]) {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 : '+'--'+'<br/>'+'邮箱 : '+'--';
								html += '<label style="float:none;width:100%">昵称：<span>' + data["data"][i]["nick_name"] + '</span></label>';
								html += '<label style="float:none;width:100%">手机：<span>--</span></label>';
								html += '<label style="float:none;width:100%">邮箱：<span>--</span></label>';
							} else {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 : '+'--'+'<br/>'+'邮箱 : '+data["data"][i]["user_email"];
								html += '<label style="float:none;width:100%">昵称：<span>' + data["data"][i]["nick_name"] + '</span></label>';
								html += '<label style="float:none;width:100%">手机：<span>--</span></label>';
								html += '<label style="float:none;width:100%">邮箱：<span>' + data["data"][i]["user_email"] + '</span></label>';
							}
						} else {
							if (data["data"][i]["user_email"] == null || "" == data["data"][i]["user_email"]) {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 : '+data["data"][i]["user_tel"]+'<br/>'+'邮箱 : '+'--';
								html += '<label style="float:none;width:100%">昵称：<span>' + data["data"][i]["nick_name"] + '</span></label>';
								html += '<label style="float:none;width:100%">手机：<span>' + data["data"][i]["user_tel"] + '</span></label>';
								html += '<label style="float:none;width:100%">邮箱：<span>--</span></label>';
							} else {
// 								html += '昵称 : '+data["data"][i]["nick_name"] +'<br/>'+'手机 : '+data["data"][i]["user_tel"]+'<br/>'+'邮箱 : '+data["data"][i]["user_email"];
								html += '<label style="float:none;width:100%">昵称：<span>' + data["data"][i]["nick_name"] + '</span></label>';
								html += '<label style="float:none;width:100%">手机：<span>' + data["data"][i]["user_tel"] + '</span></label>';
								html += '<label style="float:none;width:100%">邮箱：<span>' + data["data"][i]["user_email"] + '</span></label>';
							}
						}
					}
					html += '</div>';
					html += '</td>';
					if(data["data"][i]["level_name"]==null || data["data"][i]["level_name"]==undefined){
						html += '<td >--</td>';
					}else{
						html += '<td style="text-align:left;">' + data["data"][i]["level_name"] + '</td>';
					}
					html += '<td style="text-align:right;">' + data["data"][i]["point"] + '</td>';
					html += '<td style="text-align:right;">'+'¥'+ data["data"][i]["balance"] +'</td>';
					html += '<td>' +'注册时间 : '+ timeStampTurnTime(data["data"][i]["reg_time"]) +'<br>'+'最后登录 : '+ timeStampTurnTime(data["data"][i]["current_login_time"])+'</td>';
					html += data["data"][i]["user_status"] == 0 ? '<td style="color:red;">锁定</td>' : '<td style="color:green;">正常</td>';
					html += '<td>';
					//html += '<a href="'+__URL('ADMIN_MAIN/member/pointdetail?member_id='+ data['data'][i]['uid'])+'">积分明细</a>&nbsp;&nbsp;';
					//html += '<a href="'+__URL('ADMIN_MAIN/member/balancedetail?member_id='+ data['data'][i]['uid'])+'">余额明细</a><br/>';
					html += '<a href="'+__URL('ADMIN_MAIN/member/accountdetail?member_id='+ data['data'][i]['uid'])+'">账户明细</a><br/>';
					html += '<a onclick="recharge_point('+ data["data"][i]["uid"]+','+ data["data"][i]["point"] +')">积分调整</a>&nbsp;&nbsp;';
					html += '<a onclick="recharge_balance('+ data["data"][i]["uid"]+','+data["data"][i]["balance"]+')">余额调整</a>';
					html += '<a onclick="recharge_reg('+ data["data"][i]["uid"]+','+data["data"][i]["balance"]+')">扩展信息</a><br/>';
			
					
					if(data["data"][i]["is_system"] != 1){
						if(data["data"][i]["user_status"] == 0){
							html += '<a onclick="unlockuser('+ data["data"][i]["uid"]+')">设置解锁&nbsp;&nbsp;&nbsp;</a>';
						}else{
							html += '<a onclick="lockuser('+ data["data"][i]["uid"]+')">设置锁定&nbsp;&nbsp;&nbsp;</a>';
						}
						html += '<a onclick="modify_password('+ data["data"][i]["uid"]+')">重置密码</a>';
						html += '<a onclick="address_list('+ data["data"][i]["uid"]+')">收货地址</a><br/>';
						html += '<a href="'+__URL('ADMIN_MAIN/member/newpath?member_id='+ data['data'][i]['uid'])+'">查看足迹</a>';
						
						html += '<a onclick="modify_user('+ data["data"][i]["uid"]+')">修改</a>&nbsp;<a onclick="delete_user('+ data["data"][i]["uid"]+')">删除</a><a onclick="teshujiage('+ data["data"][i]["uid"]+')">特殊商品价格</a><br/>';
						
					}
					html += '</td>'
					html += '</tr>';
					$(".table-class tbody").append(html);
				}
			} else {
				var html = '<tr align="center"><td colspan="9">暂无符合条件的数据记录</td></tr>';
				$(".table-class tbody").html(html);
			}
			initPageData(data["page_count"],data['data'].length,data['total_count']);
			$("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
		}
	});
}
	
//全选
function CheckAll(event){
	var checked = event.checked;
	$("#productTbody input[type = 'checkbox']").prop("checked",checked);
	if(checked) $(".table-class tbody input[type = 'checkbox']").parent().addClass("selected");
	else $(".table-class tbody input[type = 'checkbox']").parent().removeClass("selected");
}

function searchData(){
	$(".more-search-container").slideUp();
	LoadingInfo(1);
}
	
//锁定会员
function lockuser(uid){
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/memberlock')}",
		data : { "id" : uid },
		success : function(data) {
			if (data["code"] > 0) {
				LoadingInfo(getCurrentIndex(uid,'#productTbody'));
				showTip(data['message'],'success');
			}else{
				showTip(data['message'],'error');
			}
		}
	});
}

//解锁会员
function unlockuser(uid){
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/memberunlock')}",
		data : { "id" : uid },
		success : function(data) {
			if (data["code"] > 0) {
				LoadingInfo(getCurrentIndex(uid,'#productTbody'));
				showTip(data['message'],'success');
			}else{
				showTip(data['message'],'error');
			}
		}
	});
}
	
//添加会员弹出
function add_user(){
	$("#add_user").modal("show");
}

//积分充值
function recharge_point(uid,point){
	$("#recharge_point").modal("show");
	$("#point_id").val(uid);
	$("#current_point").text(point);
}
//余额充值
function recharge_balance(uid,balance){
	$("#recharge_balance").modal("show");
	$("#balance_id").val(uid);
	$("#current_balance").text(balance);
}

//txx扩展信息
function recharge_reg(uid,balance){
	$("#recharge_reg").modal("show");
	$("#modify_uid").val(uid);
	$("#current_balance").text(balance);
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/getmemberdetail')}",
		data : { 'uid':uid},
		success : function(data) {
			$("#modify_uid").val(data.uid);
			
			$('#dq').val(data.member.collection_id);
			$('#modify_dianpu').val(data.member.shop_name);
			$('#modify_mianji').val(data.member.shop_space);
			$("#modify_jingli").val(data.member.diqu_jingli);
			$('#modify_zhangqi').val(data.member.zhangqi_type);
			$('#modify_kehu').val(data.member.kehu_type);
			
			
		}
	});
}

//txx显示收货地址
function address_list(uid){
	$("#address_list").modal("show");
	$("#modify_uid").val(uid);
	
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/getmemberdetail')}",
		data : { 'uid':uid},
		success : function(data) {
			var html='';
            $.each(data['shdizhi'], function(i, item) {
                html +='<tr><td>收货地址</td><td colspan="3"><p style="width: 80%;float: left;">姓名：'+item.consigner+'  手机号：'+item.mobile+'   地址：'+item.zuhedizhi+'</p><input type="radio" name="default" style="float: left;margin-top: 8px;" id="moren'+item.id+'" onclick="setdefault('+item.id+','+item.uid;
                if(item.is_default == 1){
                	html += ')" checked="checked">';
                }else{
                	html += ')">';
                }
                

                html += '<label for="moren'+item.id+'" style="width: 30px;margin-top: 4px;margin-right:10px;"">默认</label><button class="btn btn-info" onclick="addshdizhi('+item.id+')"  style="display:inline-block;margin-right:10px;">编辑</button><button type="button" class="btn btn-default" onclick="deladdress('+item.id+',this)">删除</button></td></tr>';
            });
			$('#shdizhi').append(html);
		
		}
	});
}
/*txx设置收货地址默认*/
function setdefault(addressid,uid){
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/setdefault')}",
		data : { 'id':addressid,
				 'uid':uid,
				},
		success : function(data) {
			// alert('f')
            
			
		}
	});
}
/*txx设置特殊商品价格*/
function teshujiage(uid){
	$("#teshujiage").modal("show");
	$("#teshujiages").val(uid);
	$.ajax({
		type:"post",
		url:"{:__URL('ADMIN_MAIN/Member/teshujiage')}",
		data:{
			'uid' : uid
		},
		async:true,
		success:function (data) {
			$('#tsjg').html(data);
			
		}
	});

}
/*txx设置特殊价格*/
function pricejia(obj,asd) {
    var price=$('#tsprice_'+obj).val();
    $.ajax({
        type:"post",
        url:"{:__URL('ADMIN_MAIN/Member/jiagejia')}",
        data:{
            'goodsid' : obj,'uid':asd,'price':price
        },
        async:true,
        success:function (data) {
            // var html='已设置';
            var html='<input type="button" onclick="pricejia('+obj+','+asd+')" value="取消" style="width:80px;">'
			$('#shezhi_'+obj).html(html);

        }
    });
}
/*txx取消特殊价格*/
function pricejian(obj,asd) {
    $.ajax({
        type:"post",
        url:"{:__URL('ADMIN_MAIN/Member/jiagejian')}",
        data:{
            'goodsid' : obj,'uid':asd
        },
        async:true,
        success:function (data) {
            $('#tsprice_'+obj).val('');
            // var html='确认';
            var html='<input type="button" onclick="pricejia('+obj+','+asd+')" value="确认" style="width:80px;">'
            $('#shezhi_'+obj).html(html);

        }
    });

}
//充值
function addAccount(type){
	var curr_obj = "";
	if(type == 1){
		var id = $("#point_id").val();
		var num = $("#point").val();
		var current_point = $("#current_point").text();
		var point = (parseInt(current_point) + parseInt(num));
		if(num == ''){
			showTip('积分不能为空','warning');
			return false;
		}
		var text = $("#remark_point").val();
		if(parseInt(point) < 0){
			showTip('积分不能为负数','warning');
			return false;
		}
		curr_obj = "recharge_point";
	}else{
		var id = $("#balance_id").val();
		var num = $("#balance").val();
		var current_balance = $("#current_balance").text();
		var balance = (parseInt(current_balance) + parseInt(num));
		if(num == ''){
			showTip('余额不能为空','warning');
			return false;
		}
		var text = $("#remark_balance").val();
		if(parseInt(balance) < 0){
			showTip('余额不能为负数','warning');
			return false;
		}
		curr_obj = "recharge_balance";
	}
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/addmemberaccount')}",
		data : {
			"id" : id,
			"type" : type,
			"num" : num,
			"text" : text
		},
		success : function(data) {
			if (data["code"] > 0) {
				LoadingInfo(getCurrentIndex(id,'#productTbody'));
				showTip(data['message'],'success');
				$("#"+curr_obj).modal("hide");
			}else{
				showTip(data['message'],'error');
			}
		}
	});
}

function checkUserName(username){
	var flag = true;
	$.ajax({
		type: "GET",
		url: "{:__URL('ADMIN_MAIN/member/check_username')}",
		async : false,
		data: {"username":username},
		success: function(data){
			if(data){
				flag = false;
				$("#username").css("border","1px solid red");
				$("#usernameyz").css("color","red").text("用户名已存在");
				$("#isset_username").attr("value","存在");
			}
		} 
	});
	return flag;
}

function checkMobile(mobile){
	var flag = false;
	$.ajax({
		type: "post",
		url: "{:__URL('ADMIN_MAIN/member/checkUserInfoIsExist')}",
		async : false,
		data: {"info":mobile,"type":"mobile"},
		success: function(data){
			if(data){
				flag = true;
			}
		} 
	});
	return flag;
}

function checkEmail(email){
	var flag = false;
	$.ajax({
		type: "post",
		url: "{:__URL('ADMIN_MAIN/member/checkUserInfoIsExist')}",
		async : false,
		data: {"info":email,"type":"email"},
		success: function(data){
			if(data){
				flag = true;
			}
		} 
	});
	return flag;
}

//添加会员
function addUser(){
	var username = $("#username").val();
	var nickname = $("#nickname").val();
	var password = $("#password").val();
	var level_name = $("#member_level").val();
	var tel = $("#telephone").val();
	var email = $("#member_email").val();
	var sex = $("input[name='sex']:checked").val();
	var status = $("input[name='status']:checked").val();
	
	if (username == '') {
		showTip('用户名不能为空','warning');
		return;
	}
	if(!checkUserName(username)){
		showTip('用户名已存在','warning');
		return;
	}

	if (password == null || password.length < 6) {
		showTip('密码必须不小于6位！','warning');
		return;
	}
	if (nickname == '') {
		showTip('昵称不能为空','warning');
		return;
	}
	if(tel.length > 0){
		if(!(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(tel))){ 
			showTip("手机号码有误，请重填",'warning');
			return; 
		}
		if(checkMobile(tel)){
			showTip('该手机号码已存在','warning');
			return; 
		}
	}
	if(email.length > 0){
		if(!(/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(email))){ 
			showTip('邮箱错误,请重填','warning');
			return; 
		}
		if(checkEmail(email)){
			showTip('该邮箱已存在','warning');
			return; 
		}
	}
	$.ajax({
		type : "post",
		url : __URL("ADMIN_MAIN/member/addmember"),
		data : {
			'username' : username,
			'nickname' :nickname,
			'password' : password,
			'level_name' : level_name,
			'tel' : tel,
			'email' : email,
			'sex' : sex,
			'status' : status
		},
		success : function(data) {
			if (data['code'] > 0) {
				showTip(data['message'],'success');
				$("#add_user").modal("hide");
				LoadingInfo(getCurrentIndex(1,'#productTbody'));
			} else {
				showTip(data['message'],'error');
				flag = false;
			}
		}
	});
}
//修改会员弹出
function modify_user(uid){
	var id = parseInt(uid);
	$("#modify_user").modal("show");
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/getmemberdetail')}",
		data : { 'uid':id, },
		success : function(data) {
			//alert(JSON.stringify(data['user_name']));
			$("#modify_uid").val(data.uid);
			if(data['user_name']!=''){
				$("#modify_username,#hidden_old_username").val(data.user_name);
				$("#modify_username").attr('disabled',true);
			}else{
				$("#hidden_old_username").val("");
			}
			
			$("#modify_nickname").val(data.nick_name);
			//$("#modify_password").val(data.user_password);
			$("#modify_username_hidden").val(data.user_name);
			$("#modify_telephone").val(data.user_tel);
			$("#modify_member_email").val(data.user_email);

			$("#modify_telephone").attr("old-value", data.user_tel);
			$("#modify_member_email").attr("old-value", data.user_email);

			$("#modify_member_level").find("option[value="+data.member.member_level+"]").attr("selected",true);
			
			$("#sex").find("input[value="+data.sex+"]").attr("checked",true);
			$("#status").find("input[value="+data.user_status+"]").attr("checked",true);
			
			$("#modify_user").find("input[name='status']").parent().removeClass("selected");
			$("#modify_user").find("input[name='sex']").parent().removeClass("selected");
			$("#sex").find("input[value="+data.sex+"]").parent().addClass("selected");
			$("#status").find("input[value="+data.user_status+"]").parent().addClass("selected");
		}
	});
}

	//重置密码弹出
function modify_password(uid){
	$("#modify_password").modal("show");
	$("#modify_userid").val(uid);
}

//修改密码提交
function modifypassword(){
	var uid = $("#modify_userid").val();
	var password = $("#modify_passwords").val(); 
	if (password == null || password.length < 6) {
		showTip('密码必须不小于6位！','warning');
		return false;
	}
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/updatememberpassword')}",
		data : {
			'uid':uid,
			'user_password' :password
		},
		success : function(data) {
			if (data['code'] > 0) {
				showTip('修改成功','success');
				LoadingInfo(getCurrentIndex(uid,'#productTbody'));
				$("#modify_password").modal("hide");
			} else {
				showTip('修改失败','error');
				flag = false;
			}
		}
	});
}

function delete_user(uid){
	$( "#dialog" ).dialog({
		buttons: {
			"确定": function() {
				$.ajax({
					type : "post",
					url : "{:__URL('ADMIN_MAIN/member/deletemember')}",
					data : { "uid" : uid.toString() },
					dataType : "json",
					success : function(data) {
						if(data["code"] > 0 ){
							LoadingInfo(getCurrentIndex(uid.toString(),'#productTbody'));
							showTip(data["message"],'success');
							$("#chek_all").prop("checked", false);
						}else{
							showTip(data["message"],'error');
						}
					}
				});
				$(this).dialog('close');
			},
			"取消,#f5f5f5,#666": function() {
				$(this).dialog('close');
			},
		},
		contentText:"删除会员同时会删除会员相关账户信息，确定要删除吗？",
	});
}

////修改会员
function modifyUser(){
	var uid = $("#modify_uid").val();
	var nickname = $("#modify_nickname").val();
	var username = $("#modify_username").val();

	var tel = $("#modify_telephone").val();
	var old_tel = $("#modify_telephone").attr("old-value");

	var email = $("#modify_member_email").val();
	var old_email = $("#modify_member_email").attr("old-value");

	var level_name = $("#modify_member_level").val();
	var sex = $("input[name='sex']:checked").val();
	var status = $("input[name='status']:checked").val();
	
	if(nickname == ""){
		showTip("昵称不能为空","warning");
		$("#modify_nickname").focus();
		return;
	}
	
	if (username == '') {
		showTip('用户名不能为空','warning');
		return;
	}

	if(tel.length > 0){
		if(!(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(tel))){ 
			showTip("手机号码有误，请重填",'warning');
			return false; 
		}
		if(tel != old_tel){
			if(checkMobile(tel)){
				showTip('该手机号码已存在','warning');
				return; 
			}
		}
	}
	 if(email.length > 0){
		if(!(/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(email))){ 
			showTip('邮箱错误,请重填','warning');
			return false; 
		}
		if(email != old_email){
			if(checkEmail(email)){
				showTip('该邮箱已存在','warning');
				return; 
			}
		}
	}

	var user_data = {
		'uid':uid,
		'nick_name' : nickname,
		'level_name' : level_name,
		'tel' : tel,
		'email' : email,
		'sex' : sex,
		'status' : status
	};

	if($("#hidden_old_username").val() == ""){
		user_data.user_name = username;
	}

	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/updatemember')}",
		data : user_data,
		success : function(data) {
			if (data['code'] > 0) {
				showTip(data['message'],'success');
				LoadingInfo(getCurrentIndex(uid,'#productTbody'));
				$("#modify_user").modal("hide");
			} else {
				showTip(data['message'],'error');
				flag = false;
			}
		}
	});
}
//批量删除
function batchDelete() {
	var uid= new Array();
	$("#productTbody input[type='checkbox']:checked").each(function() {
		if (!isNaN($(this).val())) {
			uid.push($(this).val());
		}
	});
	if(uid.length ==0){
		$( "#dialog" ).dialog({
			buttons: {
				"确定,#0059d6,#fff": function() {
					$(this).dialog('close');
				}
			},
			contentText:"请选择需要操作的记录",
			title:"消息提醒",
		});
		return false;
	}
	delete_user(uid);
}

/**
 * 会员数据导出
 */
function dataExcel(){
	console.log(111);return;
	var search_text = $("#search_text").val();
	var levelid = $("#level_name").val();
	$.ajax({
		url : "{:__URL('ADMIN_MAIN/member/memberExcellist')}",
		type : "post",
		data : {
			"search_text" : search_text,
			"levelid" : levelid
		},
		success : function (data){
			console.log(data);
			if(data['data'] != ""){
				window.location.href=__URL("ADMIN_MAIN/member/memberDataExcel?search_text="+search_text+"&levelid="+levelid); 	
			}else{
				showTip("没有导出的会员数据",'error');
			}
		}
	})	
}
/*txx添加扩展信息s*/
function kuozhan(){
	var uid = $("#modify_uid").val();
	var diqu=$('#dq').val();
	$.ajax({
		type : "post",
		url : "{:__URL('ADMIN_MAIN/member/updatemember')}",
		data : {
			'uid':$("#modify_uid").val(),
			'collection_id':diqu,
			'shop_name':$('#modify_dianpu').val(),
			'shop_space':$('#modify_mianji').val(),
			'modify_jingli':$("#modify_jingli").val(),
			'zhangqi_type':$('#modify_zhangqi').val(),
			'kehu_type':$('#modify_kehu').val()
		},
		success : function(data) {
			console.log(data)
			if (data['code'] > 0) {
				showMessage('success',data['message'], "{:__URL('ADMIN_MAIN/member/memberlist')}");
				LoadingInfo(getCurrentIndex(uid,'#productTbody'));
				$("#recharge_reg").hide();
			} else {
				showMessage('error',data['message']);
				flag = false;
			}
		}
	});
}
/*txx添加扩展信息e*/
// 点击显示更多搜索
$(".more-search").on("click", function(e){
	$(".more-search-container").slideToggle();
	$(document).one("click", function(){
        $(".more-search-container").slideUp();
    });
    e.stopPropagation();
})

$(".more-search-container").on("click", function(e){
    e.stopPropagation();
});

</script>
{/block}